export default {
  bind(el, binding, vnode) {
    console.log("🚀🚀 ~ bind ~ binding:", binding)
    // 获取绑定的参数
    const interval = binding.value || 1000;
    let lastTime = 0;
 
    // 创建节流函数
    function throttle(event) {
      const now = new Date();
      if (now - lastTime >= interval) {
        lastTime = now;
        binding.value(event);
      }
    }
 
    // 添加事件监听器
    el.addEventListener('scroll', throttle);
  },
  unbind(el) {
    // 移除事件监听器
    el.removeEventListener('scroll', throttle);
  }
}